package com.zhu.ttwords.bean;

import android.content.SharedPreferences;

import com.zhu.ttwords.TTWORDS;

/**
 * Created by KnightYe on 2015/4/5.
 */
public class AppBean {
    SharedPreferences sp;
    int versionCode;
    String versionName;

    int group;
    int book;

    public AppBean(SharedPreferences sp, int versionCode, String versionName, int group, int book) {
        this.sp = sp;
        this.versionCode = versionCode;
        this.versionName = versionName;
        this.group = group;
        this.book = book;
    }

    public int getBook() {
        return book;
    }

    public void setBook(int book) {
        SharedPreferences.Editor edit = sp.edit();
        edit.putInt(TTWORDS.SP_STUDY_BOOK, book);
        edit.apply();
        this.book = book;
    }

    public int getVersionCode() {
        return versionCode;
    }

    public void setVersionCode(int versionCode) {
        SharedPreferences.Editor edit = sp.edit();
        edit.putInt(TTWORDS.SP_VERSION_CODE,versionCode);
        edit.apply();
        this.versionCode = versionCode;
    }

    public String getVersionName() {
        return versionName;
    }

    public void setVersionName(String versionName) {
        SharedPreferences.Editor edit = sp.edit();
        edit.putString(TTWORDS.SP_VERSION_NAME, versionName);
        edit.apply();
        this.versionName = versionName;
    }

    public int getGroup() {
        return group;
    }

    public void setGroup(int group) {
        SharedPreferences.Editor edit = sp.edit();
        edit.putInt(TTWORDS.SP_STUDY_GROUP, group);
        edit.apply();
        this.group = group;
    }
}
